#include "bo3d.h"

// Sets the initial background colour of the viewport (before rendering). 
BBDECL void __stdcall o_setBackgroundColour(Ogre::Viewport* vp, float red, float green, float blue, float alpha)
{
	try
	{
		vp->setBackgroundColour(Ogre::ColourValue(red, green, blue, alpha));
	}
	catch(Ogre::Exception &e)
	{
		std::cout << e.getDescription() << std::endl;
	}
}

// Gets one of the actual dimensions of the viewport, a value in pixels. 
BBDECL int __stdcall o_getActualWidth(Ogre::Viewport* vp)
{
	int w;
	try
	{
		w = vp->getActualWidth();
	}
	catch(Ogre::Exception &e)
	{
		std::cout << e.getDescription() << std::endl;
	}

	return w;
}

// Gets one of the actual dimensions of the viewport, a value in pixels. 
BBDECL int __stdcall o_getActualHeight(Ogre::Viewport* vp)
{
	int h;
	try
	{
		h = vp->getActualHeight();
	}
	catch(Ogre::Exception &e)
	{
		std::cout << e.getDescription() << std::endl;
	}

	return h;
}

// Sets the camera to use for rendering to this viewport. 
BBDECL void __stdcall o_setCamera(Ogre::Viewport* vp, Ogre::Camera* cam)
{
	try
	{
		vp->setCamera(cam);
	}
	catch(Ogre::Exception &e)
	{
		std::cout << e.getDescription() << std::endl;
	}
}

